import store from '@/store'

const auth = {
  inserted(el, binding, vnode, oldVnode) {
      const {value} = binding
      const buttons = store.getters.buttons
      let v = buttons.find((item) => item.code == value)
      if (!v) {
        //移除元素
        el.parentNode.removeChild(el)
      }
  },
}

auth.install = function (Vue) {
  //定义指令名
  Vue.directive('auth', auth)
}


export default auth